//
//  SchoolSelectCell.m
//  HotWord
//
//  Created by 贺 欢 on 13-3-3.
//
//

#import "QuestionTagSelectCell.h"

@interface QuestionTagSelectCell ()
@property (retain, nonatomic) IBOutlet UILabel *orderLabel;
@property (retain, nonatomic) IBOutlet UILabel *titleLabel;
@property (retain, nonatomic) IBOutlet UIImageView *allowImageView;
@property (retain, nonatomic) IBOutlet UIImageView *selectMarkImageView;
@end

@implementation QuestionTagSelectCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

- (void)dealloc
{
    [_titleLabel release];
    [_allowImageView release];
    [_selectMarkImageView release];
    [_orderLabel release];
    [super dealloc];
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];
    if (_type == QuestionTagSelectCellTypeTagSelect)
    {
        _selectMarkImageView.hidden = !selected;
    }
}

- (void)setTitle:(NSString *)title
{
    _orderLabel.text = [NSString stringWithFormat:@"%d",self.tag];
    _titleLabel.text = title;
    if (_type == QuestionTagSelectCellTypeCategory)
    {
        _allowImageView.hidden = NO;
        _selectMarkImageView.hidden = YES;
    }
    else
    {
        _allowImageView.hidden = YES;
        _titleLabel.left = 75;
        _titleLabel.width = 180;
    }
}

@end
